package cn.iocoder.yudao.module.of.dal.mysql.taskapprovalhistory;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.of.dal.dataobject.taskapprovalhistory.TaskApprovalHistoryDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.of.controller.admin.taskapprovalhistory.vo.*;

/**
 * 记录任务的审批历史信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface TaskApprovalHistoryMapper extends BaseMapperX<TaskApprovalHistoryDO> {

    default PageResult<TaskApprovalHistoryDO> selectPage(TaskApprovalHistoryPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TaskApprovalHistoryDO>()
                .eqIfPresent(TaskApprovalHistoryDO::getTaskId, reqVO.getTaskId())
                .eqIfPresent(TaskApprovalHistoryDO::getApprovalStatus, reqVO.getApprovalStatus())
                .eqIfPresent(TaskApprovalHistoryDO::getApprovalUserId, reqVO.getApprovalUserId())
                .eqIfPresent(TaskApprovalHistoryDO::getApprovalOpinion, reqVO.getApprovalOpinion())
                .betweenIfPresent(TaskApprovalHistoryDO::getApprovalTime, reqVO.getApprovalTime())
                .betweenIfPresent(TaskApprovalHistoryDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TaskApprovalHistoryDO::getId));
    }

}